package cn.stylefeng.guns.sys.modular.system.entity.Enum;

import lombok.Getter;

/**
 * 角色枚举类
 *
 * @author jiangge
 * @Date 2020/9/26 14:45
 */
@Getter
public enum LevelEnum {
    LEVEL_1(1, "门店"),
    LEVEL_2(2, "一级科目"),
    LEVEL_3(3, "二级科目"),
    LEVEL_4(4, "三级"),
    LEVEL_5(5, "四级");

    LevelEnum(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    private Integer code;

    private String msg;

    public static LevelEnum getByMsg(String value){
        for(LevelEnum roleIdEnum : values()){
            if (roleIdEnum.getMsg().equals(value)) {
                return roleIdEnum;
            }
        }
        return null;
    }

    public static LevelEnum getByCode(Integer value){
        for(LevelEnum roleIdEnum : values()){
            if (roleIdEnum.getCode().equals(value)) {
                return roleIdEnum;
            }
        }
        return null;
    }

}
